home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.19981211-19990422
/
000134_news@watsun.cc.columbia.edu _Mon Jan 18 13:15:47 1999.msg
< prev
next >
Wrap
Internet Message Format
|
1999-04-21
|
4KB
Return-Path: <news@watsun.cc.columbia.edu>
Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
by watsun.cc.columbia.edu (8.8.5/8.8.5) with ESMTP id NAA22365
for <kermit.misc@watsun.cc.columbia.edu>; Mon, 18 Jan 1999 13:15:46 -0500 (EST)
Received: (from news@localhost)
by newsmaster.cc.columbia.edu (8.8.5/8.8.5) id MAA13421
for kermit.misc@watsun.cc.columbia.edu; Mon, 18 Jan 1999 12:53:41 -0500 (EST)
X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Subject: Re: not the same string with echo as with write file
Date: 18 Jan 1999 17:53:40 GMT
Organization: Columbia University
Message-ID: <77vsf4$d39$1@newsmaster.cc.columbia.edu>
To: kermit.misc@mailrelay2.cc.columbia.edu
In article <36a35d8c.97279@news.calvacom.fr>,
Dominique Ottello <do11@calva.net> wrote:
: MS-Kermit 3.15 under MS-DOS 6.2
:
: With the under take file I want to have the same output string on screen
: and in a file :
: ; ------------ Beginning of take file ----------------
: def Avion A320
: def Ename AKA10AAJ
: def Filelog Essai.log
: def Log_S Fichier
: def SN ECDD3022
: def \%h T1
: def \%n 005
: def \%p 1459M55
: ;
: def print_PC open append \m(FileLog),-
: write file {\v(Time) \%1\13\10},close write-file
: ;
: ; Warning : the next two lines are only one line (Word Wrap)
: ass Affiche copy C:\\KERMIT\\FICHIERS\\\m(Ename).\%h
: C:\\\m(Avion)\\\%p\\\m(SN)\\\v(ndate).\%n
: ;
: echo {\m(Affiche)}
: print_PC {\m(Affiche)}
: ; ------------ End of take file ----------------
:
: The echo line does exactly what I want :
: Warning : the next two lines are only one line (Word Wrap)
: 14:55:37 copy C:\KERMIT\FICHIERS\AKA10AAJ.T1
: C:\A320\1459M55\ECDD3022\19990118.005
:
: Unfortunately, the content of the file ESSAI.LOG is not the same as the
: screen but :
: Warning : the next two lines are only one line (Word Wrap)
: 14:55:37 copy C:\KERMIT\FICHIERS\AKA10AAJ.T1
: C:\A320�9M55\ECDD3022�90118.005
:
: Despite the fact that the value seen by "show macro Affiche" is right, it
: seems that it is badly interpreted inside the macro "print_PC".
:
: The "\\\%p" is not interpreted as one "\" plus the content of the macro \%p
: but as a character "\145" plus characters following i.e. "9M55". There is
: the same thing for "\\\v(ndate)" that is interpreted as character "\199"
: plus characters following i.e. "90118" in place of string "\19990118".
:
: Is there a bug or a misunderstanding ?
:
: Is there a way to bypass this problem ?
:
Perhaps the worst thing about the Kermit script language is the conflict
between its use of backslash (\) as the "distinguished character" and the
use of backslash by DOS as the directory separator. Luckily we can get
around this problem in Windows 95/98/NT and OS/2 by using "/" rather than
"\" as the directory separator (in most cases), but that is not possible
in DOS. Of course we would have different, but similar, problems no matter
what other distinguished character was chosen.
When a DOS filename or a directory segment starts with a digit we have
double trouble. For example, suppose you have the following DOS
directory:
C:\123
(which, in fact, is well-known to Lotus users). To Kermit, "\123" means
"character number 123", which happens to be "{".
In your case, you have:
C:\A320\1459M55\ECDD3022\19990118.005
turning into:
C:\A320�9M55\ECDD3022�90118.005
Why is this happening? Because ECHO is a command. The argument of ECHO
is evaluated once in its executation.
But print_PC is a macro. Its argument is evaluated in the command:
print_PC {\m(Affiche)}
itself, but then, inside the macro, \m(Affiche) has been assigned to \%1,
which is evaluated again.
Try this:
def print_PC open append \m(FileLog),-
write file {\v(Time) \fcontents(\%1)\13\10},close write-file
- Frank